<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="../common.jsp"%>
<%@ page import="cn.firstsoft.firstframe.admin.PropertyFile"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<%
	String initPersonAllSql = PropertyFile.readValue("easconfig.properties", "eas.initPersonAllSql");
	if (initPersonAllSql == null) initPersonAllSql = "";
	String detailInfo = PropertyFile.readValue("easconfig.properties", "eas.detailInfo");
	String positionPOS = PropertyFile.readValue("easconfig.properties","eas.positionPOS");
%>
<%
	String flag = request.getParameter("flag");
	String ret = "";
	if ("suc".equals(flag)) {
		ret = "设置成功,并请重新启动服务器！";
		
    }else if("fail".equals(flag)) {
    	ret = "设置保存失败！";
	}else{
		ret = "";
	}
%>
<c:set var="retValue" value="<%=ret%>" />



<html>
	<head>
		<title>管理控制台 - 环境设置 - 数据同步设置</title>
		<%@ include file="/common/meta2.jsp"%>
		<link href="../style.css" type="text/css" rel="stylesheet">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	</head>
	<body>
		<form method="post" name="integrationForm"
			action="data_sync_setting_update.jsp">
			&nbsp;
			<input class="button" type="submit" value="提&nbsp;&nbsp;交" />
			<input class="button" type="reset" value="重&nbsp;&nbsp;置" />
			<c:if test="${not empty retValue }">
				<br>
				<c:out value="${retValue }" />
			</c:if>
			<table width="100%" align="center">
				<tr>
					<th class="listViewPaginationTdS1" align="left" colSpan="4">
						数据同步设置
					</th>
				</tr>
	    <tr>
			<TH align="right" width="20%">名&nbsp;&nbsp;称</TH>
			<TH align="left" width="30%">设置值</TH>
			<TH align="left" width="20%">默认值</TH>
			<TH align="left" width="30%">描&nbsp;&nbsp;述</TH>
		</tr>
		 <tr>
			<td  class=dataLabel align="right">
				基础数据同步：
			</td>
			<td  class=dataField align="left">
					<input type="radio" id="dataSyncNo" name="dataSync"  value="no" onclick="dataSyncChanage()" />
					不同步
					<input type="radio" id="dataSyncEas" name="dataSync" value="eas" onclick="dataSyncChanage()"/>
					同步EAS
					<input type="radio" id="dataSyncK3" name="dataSync" value="k3" onclick="dataSyncChanage()"/>
					同步K/3
			</td>
			<td align="left" style="word-break: break-all">
				不同步
			</td>
			<td  align="left">
				同步基本数据的内容，包括：不同步、同步EAS、同步K/3默认不同步
			</td>
           </tr>
           <tbody id="easDataSyncId"  style="display:none">
           <tr>
			<td class=dataLabel  align="right" rowspan="3">EAS集成参数：</td>
			<td class=dataField >
				是否同步非用户职员：
				<input type="radio" name="initPersonAllSql" value="false" <%="".equals(initPersonAllSql)?"checked":"" %>>不同步
				<input type="radio" name="initPersonAllSql" value="true" <%=!"".equals(initPersonAllSql)?"checked":"" %>>同步
			</td>
			 <td class=dataField >
				同步
			</td>
			<td align="left" rowspan="3">
				配置文件：<a href="../application/file_download.jsp?filePath=<%=(System.getProperty("oa_application.config")+"/easconfig.properties") %>&fileName=easconfig.properties">easconfig.properties</a>
			</td>
		</tr>
		    <tr>
			
			<td class=dataField >
				&nbsp;&nbsp;&nbsp;&nbsp;是否同步联系信息：
				<input type="radio" name="detailInfo" value="false" <%="false".equals(detailInfo)?"checked":"" %> />不同步
				<input type="radio" name="detailInfo" value="true" <%="true".equals(detailInfo)?"checked":"" %> />同步
			</td>
		    <td class=dataField >
				不同步
			</td>
		</tr>
	  <tr>
			<td class=dataField >
				是否同步职位顺序号：
				<input type="radio" name="positionPOS" value="false" <%="false".equals(positionPOS)?"checked":"" %> />不同步
				<input type="radio" name="positionPOS" value="true" <%="true".equals(positionPOS)?"checked":"" %> />同步
			</td>
		    <td class=dataField >
				不同步
			</td>
		</tr>
	 </tbody>
	</table>
  </form>
  
  	  <script language="javascript">
			   //判断是否为eas集成
			  var easDataSync = <%=PropertyFile.readValue("firstframe.properties", "plugins.eas") %>;
			  var k3DataSync = <%=(PropertyFile.readValue("firstframe.properties", "plugins.k3")==null?"false":PropertyFile.readValue("firstframe.properties", "plugins.k3")) %>;
			  easDataSync =  easDataSync.toString();
			  k3DataSync = k3DataSync.toString();
			  function init(){
			  
			    if(k3DataSync=='true'){
			      document.getElementById("dataSyncK3").checked = true;
			    }else if(easDataSync=='true'){
			      document.getElementById("dataSyncEas").checked = true;
			    }else{
			      document.getElementById("dataSyncNo").checked = true;
			    }
			    chanageEasSettingShow(easDataSync);
			  }
              //根据值设置eas集成设置是否显示			  
			  function chanageEasSettingShow(isDataSync){
			    if(isDataSync=='true'){
			      document.getElementById("easDataSyncId").style.display='inline';   
			    }else{
			      document.getElementById("easDataSyncId").style.display='none';   
			    }
			  }
             
             //当系统集成选项被修改时，		
		     function dataSyncChanage(){
		       var dataSync = getRadioValue("dataSync");
		       if(dataSync == 'eas'){
		        easDataSync = 'true';
		       }else{
		         easDataSync = 'false';
		       }
		       chanageEasSettingShow(easDataSync);
		     }
			 init();
			</script>
  
  
  
 </body>
</html>
